﻿using Prism.Commands;
using Prism.Mvvm;
using RoboAssembleX.Application.AddBoard1;
using RoboAssembleX.Application.AddBoard2;
using RoboAssembleX.Application.AddGlass;
using RoboAssembleX.Application.AddGlass1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RoboAssembleX.ViewModels
{
    public class ViewAddBoard1ControlViewModel: BindableBase
    {
        private readonly AddBoard1Service AddBoard1Service;
        public AddBoard1Model AddBoard1Model { get; }
        public DelegateCommand<string> ButtonCommand { get; private set; }
        public ViewAddBoard1ControlViewModel(AddBoard1Service AddBoard1Service, AddBoard1Model AddBoard1Model)
        {
            this.AddBoard1Service = AddBoard1Service;
            this.AddBoard1Model = AddBoard1Model;
            ButtonCommand = new DelegateCommand<string>(ButtonMethod);

            Task.Run(async () =>
            {
                await Task.Delay(1000);
                AddBoard1Service.SwitchReadData();
            });
        }
        private void ButtonMethod(string menuName)
        {
            switch (menuName)
            {
                case "SwitchReadData":
                    AddBoard1Service.SwitchReadData();
                    break;
                case "Action":
                    AddBoard1Service.Action();
                    break;
            }
        }
    }
}
